﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.esriSystem;

namespace WorldViewSolutions.ArcGISServer.SOE
{
    /// <summary>
    /// Singleton log.
    /// </summary>
    /// <remarks></remarks>
    public sealed class ServiceCache
    {
        /// <summary>
        /// Allocate ourselves. We have a private constructor, so no one else can.
        /// </summary>
        private static readonly ServiceCache _instance = new ServiceCache();

        /// <summary>
        /// 
        /// </summary>
        private Dictionary<string, WorldViewSolutions.ArcGISServer.SOE.DataSources.IMapDResource> _items;


        /// <summary>
        /// Access SiteStructure.Instance to get the singleton object.
        /// Then call methods on that instance.
        /// </summary>
        /// <remarks></remarks>
        private static ServiceCache Instance
        {
            get { return _instance; }
        }

        /// <summary>
        /// Gets or sets the items.
        /// </summary>
        /// <value>The items.</value>
        /// <remarks></remarks>
        public static Dictionary<string, WorldViewSolutions.ArcGISServer.SOE.DataSources.IMapDResource> Items
        {
            get { return _instance._items; }
            set { _instance._items = value; }
        }


        /// <summary>
        /// This is a private constructor.
        /// </summary>
        /// <remarks></remarks>
        private ServiceCache()
        {
            _items = new Dictionary<string, WorldViewSolutions.ArcGISServer.SOE.DataSources.IMapDResource>();
        }
    }
}